#include "dialog.h"

Dialog::Dialog(QWidget* parent)
    : QDialog(parent)
{
    QVBoxLayout* layout = new QVBoxLayout;
    this->setLayout(layout);

    QLabel* label = new QLabel("这是一段文本");
    QPushButton* bt = new QPushButton("关闭");

    layout->addWidget(label);
    layout->addWidget(bt);

    connect(bt, &QPushButton::clicked, this, &Dialog::handle);
}

void Dialog::handle()
{
    this->close();
}
